package com.vains.client;

import com.vains.client.impl.AuthClientBack;
import com.vains.system.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(value = "auth-server", fallback = AuthClientBack.class)
public interface AuthClient {

    @GetMapping("/oauthPermission/hasAuth")
    Result<Boolean> hasAuth(@RequestParam("url") String url, @RequestParam("access_token") String accessToken);

    /**
     * 检查token
     * @param value token
     * @return 检查结果
     */
    @GetMapping("/oauth/check_token")
    Map<String, Object> checkToken(@RequestParam("token") String value);

}
